<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <script src="../vueJS/VUE.js"></script>
</head>

<body>
    <div id="root">
        <h1>今天天气是{{wether}}</h1>
        <!-- 也可以在click后面直接写一写简单语句，中间用;隔开，复杂的建议写函数 -->
        <button v-on:click="change">点击更换</button>
    </div> 
    <script type="text/javascript">
    Vue.config.productionTip = false
    const vm = new Vue({
        el:'#root',
        data:{
            tianqi:true
        },
        methods:{
            change(){
                this.tianqi = !this.tianqi
                
            }
        },
        computed:{
            wether:{
                get(){
                    return this.tianqi?'炎热':'凉爽'
                }
            }
        }
    })
    </script>
</body>
</html>